package com.example.retrofitdemo;

import android.util.Log;

/**
 * Created by tangjiangxu on 11/22/17.
 * 金山词霸返回的数据类
 * json格式为：
 * status: 请求成功时为1
 * content:内容信息
 *   from:原文信息
 *   to：译文内容类型
 *   vendor:来源平台
 *   out:译文内容
 *   err_no:请求成功时为0
 */

public class Translate {
    private static final String TAG = "Translate";
    private int status;
    private Content content;

    private static class Content {
        private String from;
        private String to;
        private String vendor;
        private String out;
        private int errNo;
    }

    /**
     * 显示结果
     */
    public void show() {
        Log.e(TAG, "show:staus-" + status + ";from-" + content.from + ";to-" + content.to + ";vendor-" + content.vendor + ";out-" + content.out + ";errNo-" + content.errNo);
    }

    @Override
    public String toString() {
        return "staus-" + status +
                "\nfrom-" + content.from +
                "\nto-" + content.to +
                "\nvendor-" + content.vendor +
                "\nout-" + content.out +
                "\nerrNo-" + content.errNo;
    }
}
